package endereco;

import org.hibernate.SQLQuery;

import persistencia.GenericDAOAbstract;

public class EnderecoDAOHibernate extends GenericDAOAbstract<Endereco, Long>
		implements EnderecoDAO {
	
	public Endereco buscaPorCep(String cep){
		String sql ="SELECT * FROM tend_endereco e where e.cep = '" + cep + "'";
		SQLQuery sqlQuery = getSession().createSQLQuery(sql).addEntity(Endereco.class);
		return (Endereco) sqlQuery.uniqueResult();
	}

}
